Map indicates the layout of the F1 generation resulting from a cross between EC201 and EC103 parents. Column 1 is approximately lengthways facing north.
“Map of F1 Trees”
Diagram indicates the areas of leaf collection regarding height. Each Tree had 10 leaves collected, 3 from Low, 4 from Mid and 3 from High. The first leaf sampled was measured twice for replication comparison.
“Diagram of leaf collection levels”
“Full.xlsx” contains measurement information from sampling with the Dualex (https://www.force-a.com/en/capteurs-optiques-optical-sensors/dualex-scientific-chlorophyll-meter/), including;
Surface content of chlorophyll in ?g/cm? (Chl)
The index of epidermal flavanols (Flav)
Nitrogen Balance Index status (NBI)
Epidermal Anthocyanins (Anth).
It also contains information about the block position, the leaf height information, and presense or absence of flowering
Sheet “Dup” contains only the samples that were replicated.
# Import Data Measures
Data <-read.xlsx("Full.xlsx", sheetName ="Full")
head(Data)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1 4 CG 0 0 0 20 OG CG N
## 2 4 CG 0 0 0 20 OG CG N
## 3 4 CG 0 0 0 20 OG CG N
## 4 4 CG 0 0 0 20 OG CG N
## 5 4 CG 0 0 0 20 OG CG N
## 6 4 CG 0 0 0 20 OG CG N
## measure Height Flower Chl Flav Anth NBI
## 1 9 H Y 28.220 2.418 0.205 11.67
## 2 3 L Y 27.958 2.298 0.691 12.17
## 3 11 H Y 33.727 2.458 0.527 13.72
## 4 4 L Y 25.938 1.758 0.172 14.76
## 5 10 H Y 36.205 2.283 0.270 15.86
## 6 6 M Y 34.332 2.115 0.150 16.23
Data$Column = as.factor(Data$Column)
Data$Row = as.factor(Data$Row)
# Import Replicate Data
Dup <-read.xlsx("Full.xlsx", sheetName ="Dup")
head(Dup)
## Collection.Day group Group.ID Tree.ID Rep. measure Height Chl Flav
## 1 2.0 23 60 IN4DV Y1 1 L 1.916 2.363
## 2 1.5 3 1 IN4BT Y1 1 L 3.124 2.300
## 3 2.0 17 54 IN4DL Y2 2 L 3.414 1.826
## 4 1.5 32 28 IN4CP Y2 2 L 4.097 1.943
## 5 2.0 9 46 IN4DC Y1 1 L 4.909 1.928
## 6 1.5 5 3 IN4BW Y1 1 L 4.924 1.848
## Anth NBI
## 1 0.174 0.81
## 2 0.191 1.36
## 3 0.112 1.87
## 4 0.051 2.11
## 5 0.103 2.55
## 6 0.165 2.66
#Isolate Crimson Glory Outgroup
CG = Data[c(1:11),]
head(CG)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1 4 CG 0 0 0 20 OG CG N
## 2 4 CG 0 0 0 20 OG CG N
## 3 4 CG 0 0 0 20 OG CG N
## 4 4 CG 0 0 0 20 OG CG N
## 5 4 CG 0 0 0 20 OG CG N
## 6 4 CG 0 0 0 20 OG CG N
## measure Height Flower Chl Flav Anth NBI
## 1 9 H Y 28.220 2.418 0.205 11.67
## 2 3 L Y 27.958 2.298 0.691 12.17
## 3 11 H Y 33.727 2.458 0.527 13.72
## 4 4 L Y 25.938 1.758 0.172 14.76
## 5 10 H Y 36.205 2.283 0.270 15.86
## 6 6 M Y 34.332 2.115 0.150 16.23
#Isolate East Cape 201 Parent
EC201 = Data[c(12:21),]
head(EC201)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 12 4 EC201 0 0 0 18 P1 EC201 N
## 13 4 EC201 0 0 0 18 P1 EC201 N
## 14 4 EC201 0 0 0 18 P1 EC201 N
## 15 4 EC201 0 0 0 18 P1 EC201 N
## 16 4 EC201 0 0 0 18 P1 EC201 N
## 17 4 EC201 0 0 0 18 P1 EC201 N
## measure Height Flower Chl Flav Anth NBI
## 12 9 H Y 30.722 2.138 0.156 14.37
## 13 6 M Y 45.272 1.861 0.075 24.33
## 14 10 H Y 46.174 1.868 0.052 24.72
## 15 8 M Y 57.480 1.897 0.037 30.30
## 16 5 M Y 57.752 1.681 0.125 34.35
## 17 3 L Y 54.927 1.592 0.061 34.50
#Isolate East Cape 103 Parent
EC103 = Data[c(22:33),]
head(EC103)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 22 4 EC103 0 0 0 19 P2 EC103 N
## 23 4 EC103 0 0 0 19 P2 EC103 N
## 24 4 EC103 0 0 0 19 P2 EC103 N
## 25 4 EC103 0 0 0 19 P2 EC103 N
## 26 4 EC103 0 0 0 19 P2 EC103 N
## 27 4 EC103 0 0 0 19 P2 EC103 N
## measure Height Flower Chl Flav Anth NBI
## 22 8 M Y 31.471 1.324 0.018 23.77
## 23 11 H Y 57.349 2.111 0.053 27.17
## 24 4 L Y 43.949 1.478 0.004 29.73
## 25 12 H Y 56.779 1.846 0.108 30.75
## 26 9 M Y 55.916 1.746 0.055 32.03
## 27 10 H Y 57.809 1.746 0.054 33.11
#Isolate Offspring from the Parental Cross
F1 = Data[c(34:1825),]
head(F1)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 34 1 F1 1 1 1 15 1 IN4BT N
## 35 1 F1 1 1 1 15 1 IN4BT N
## 36 1 F1 1 1 1 15 1 IN4BT N
## 37 1 F1 1 1 1 15 1 IN4BT N
## 38 1 F1 1 1 1 15 1 IN4BT N
## 39 1 F1 1 1 1 15 1 IN4BT Y1
## measure Height Flower Chl Flav Anth NBI
## 34 8 M N 3.268 1.958 0.143 1.67
## 35 2 L N 23.326 2.581 0.065 9.04
## 36 11 M N 24.682 2.265 0.112 10.90
## 37 7 M N 27.068 2.229 0.084 12.14
## 38 14 H N 27.459 2.135 0.138 12.86
## 39 3 L N 34.592 2.583 0.048 13.39
Replicates were taken by measuring a single leaf sample from each tree twice, in order to establish consistency and reliability of measurements with the Dualex.
#Anthocyanin
RepAnth = summary(Dup$Anth)
#Chlorophyll
RepChl = summary(Dup$Chl)
#Flavanoid
RepFlav = summary(Dup$Flav)
#NBI
RepNBI =summary(Dup$NBI)
as.table(rbind(RepAnth,RepChl,RepFlav,RepNBI))
## Min. 1st Qu. Median Mean 3rd Qu.
## RepAnth 0.00100000 0.06500000 0.09850000 0.09799367 0.12525000
## RepChl 1.91600000 25.82475000 36.02700000 35.76269937 46.61000000
## RepFlav 1.05600000 1.76775000 1.99400000 1.96720570 2.19725000
## RepNBI 0.81000000 12.70250000 18.19000000 18.73398734 24.45750000
## Max.
## RepAnth 0.25400000
## RepChl 59.67400000
## RepFlav 2.71400000
## RepNBI 43.49000000
Dup2 = group_by(Dup,Rep.)
Dup2 = summarise(Dup2, Anth = mean(Anth, na.rm = T),Chl = mean(Chl, na.rm = T), Flav = mean(Flav,na.rm = T), NBI = mean(NBI, na.rm = T))
head(Dup2)
## # A tibble: 2 x 5
## Rep. Anth Chl Flav NBI
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 Y1 0.0983 34.9 1.98 18.2
## 2 Y2 0.0977 36.6 1.95 19.2
#Anthocyanin Replicate Plots
plot1<- ggplot(Dup) + aes(x = Rep., y = Anth ) + geom_boxplot() + ylab("Anthocyanin Measure") + xlab("Replicate Number") + ggtitle("Anthocyanin of Replicate Samples") +stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3);plot1
plot11<-ggplot(Dup) +aes(x = Tree.ID, y = Anth) + geom_point() +geom_hline(yintercept = mean(Dup$Anth))+ ylab("Anthocyanin Measure") + xlab("Tree ID") + ggtitle("Anthocyanin of Replicate Samples")
plot12 <-ggplot(Dup) +aes(Anth) +geom_histogram() + stat_bin(binwidth = 0.001) + ylab("Frequency") + xlab("Anthocyanin Measure") + ggtitle("Anthocyanin of Replicate Samples")
grid.arrange(plot11,plot12)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Chlorophyll Replicate Plots
plot2<- ggplot(Dup) + aes(x = Rep., y = Chl) + geom_boxplot()+ ylab("Chlorophyll Measure") + xlab("Replicate Number") + ggtitle("Chlorophyll of Replicate Samples")+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3,show_guide = FALSE);plot2
## Warning: `show_guide` has been deprecated. Please use `show.legend`
## instead.
plot21 <-ggplot(Dup) +aes(x = Tree.ID, y = Chl) + geom_point() +geom_hline(yintercept = mean(Dup$Chl))+ ylab("Chlorophyll Measure") + xlab("Tree ID") + ggtitle("Chlorophyll of Replicate Samples")
plot22 <-ggplot(Dup) +aes(Chl) +geom_histogram() + stat_bin(binwidth = 2) + ylab("Frequency") + xlab("Chlorophyll Measure") + ggtitle("Chlorophyll of Replicate Samples")
grid.arrange(plot21,plot22)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Flavonol Replicate Plots
plot3<- ggplot(Dup) + aes(x = Rep., y = Flav ) + geom_boxplot()+ ylab("Flavonol Measure") + xlab("Replicate Number") + ggtitle("Flavonol of Replicate Samples")+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3);plot3
plot31 <-ggplot(Dup) +aes(x = Tree.ID, y = Flav) + geom_point() +geom_hline(yintercept = mean(Dup$Flav))+ ylab("Flavonol Measure") + xlab("Tree ID") + ggtitle("Flavonol of Replicate Samples")
plot32 <-ggplot(Dup) +aes(Flav) +geom_histogram() + stat_bin(binwidth = 0.001)+ ylab("Frequency") + xlab("Flavonol Measure") + ggtitle("Flavonol of Replicate Samples")
grid.arrange(plot31,plot32)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#NBI Replicate Plots
plot4<- ggplot(Dup) + aes(x = Rep., y = NBI ) + geom_boxplot()+ ylab("NBI Measure") + xlab("Replicate Number") + ggtitle("NBI of Replicate Samples")+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3);plot4
plot41 <-ggplot(Dup) +aes(x = Tree.ID, y = NBI) + geom_point() +geom_hline(yintercept = mean(Dup$NBI)) + ylab("NBI Measure") + xlab("Tree ID") + ggtitle("NBI of Replicate Samples")
plot42 <-ggplot(Dup) +aes(NBI) +geom_histogram() + stat_bin(binwidth = 2)+ ylab("Frequency") + xlab("NBI Measure") + ggtitle("NBI of Replicate Samples")
grid.arrange(plot41,plot42)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
There is no statistically significant differences between the two groups of measurements, this is a good sign indicative of the accuracy of the Dualex.
#Chlorophyll Anova
mod <-lm(Dup$Chl ~ Dup$Rep.)
anova(mod)
## Analysis of Variance Table
##
## Response: Dup$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 218 218.33 1.033 0.3102
## Residuals 314 66366 211.36
#Flavanol Anova
mod2 <-lm(Dup$Flav ~ Dup$Rep.)
anova(mod2)
## Analysis of Variance Table
##
## Response: Dup$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 0.0521 0.052129 0.6506 0.4205
## Residuals 314 25.1596 0.080126
#Anthocyanin Anova
mod3 <-lm(Dup$Anth ~ Dup$Rep.)
anova(mod3)
## Analysis of Variance Table
##
## Response: Dup$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 0.00003 0.0000304 0.0151 0.9023
## Residuals 314 0.63303 0.0020160
#NBI Anova
mod4 <-lm(Dup$NBI ~ Dup$Rep.)
anova(mod4)
## Analysis of Variance Table
##
## Response: Dup$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 82.5 82.530 1.115 0.2918
## Residuals 314 23241.0 74.016
The absence of statistically significant results indicates that our replicates are likely to be consistent.
Allocation refers to which group measurements were taken from, i.e. A Parental Tree (EC103 or EC201), Outgroup Tree (CG), Parental Offspring (F1)
#Anthocyanin Mean
AllAnth = summary(Data$Anth)
#Chlorophyll Mean
AllChl = summary(Data$Chl)
#Flavanol Mean
AllFlav = summary(Data$Flav)
#NBI Mean
AllNBI = summary(Data$NBI)
as.table(rbind(AllAnth,AllChl,AllFlav,AllNBI))
## Min. 1st Qu. Median Mean 3rd Qu.
## AllAnth 0.00100000 0.06800000 0.09600000 0.09772877 0.12400000
## AllChl 0.13000000 24.10200000 36.21000000 35.21443342 46.82300000
## AllFlav 1.05600000 1.80600000 1.97800000 1.96440493 2.12800000
## AllNBI 0.07000000 12.14000000 18.64000000 18.34807123 24.44000000
## Max.
## AllAnth 0.69100000
## AllChl 59.90500000
## AllFlav 2.86100000
## AllNBI 49.17000000
Data2 = group_by(Data, Allocation)
Data2 = summarise(Data2, Anth = mean(Anth, na.rm = T),Chl = mean(Chl, na.rm = T), Flav = mean(Flav, na.rm = T), NBI = mean(NBI, na.rm = T))
head(Data2)
## # A tibble: 4 x 5
## Allocation Anth Chl Flav NBI
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 CG 0.258 36.0 2.17 16.7
## 2 EC103 0.0588 52.6 1.60 33.1
## 3 EC201 0.0779 52.6 1.71 31.7
## 4 F1 0.0971 35.0 1.97 18.2
CGAnth = summary(CG$Anth)
F1Anth = summary(F1$Anth)
Anth201 = summary(EC201$Anth)
Anth103 = summary(EC103$Anth)
CGChl = summary(CG$Chl)
F1Chl = summary(F1$Chl)
Chl201 = summary(EC201$Chl)
Chl103 = summary(EC103$Chl)
CGFlav = summary(CG$Flav)
F1Flav = summary(F1$Flav)
Flav201 = summary(EC201$Flav)
Flav103 = summary(EC103$Flav)
CGNBI = summary(CG$NBI)
F1NBI = summary(F1$NBI)
NBI201 = summary(EC201$NBI)
NBI103 = summary(EC103$NBI)
as.table(rbind(CGAnth,F1Anth,Anth201,Anth103,CGChl,F1Chl,Chl201,Chl103,CGFlav,F1Flav,Flav201,Flav103,CGNBI,F1NBI,NBI201,NBI103))
## Min. 1st Qu. Median Mean 3rd Qu.
## CGAnth 0.10700000 0.16100000 0.20100000 0.25763636 0.24250000
## F1Anth 0.00100000 0.06800000 0.09650000 0.09711830 0.12400000
## Anth201 0.03700000 0.05425000 0.06850000 0.07790000 0.08400000
## Anth103 0.00400000 0.03725000 0.05350000 0.05883333 0.08925000
## CGChl 25.93800000 30.97350000 35.70700000 36.02836364 40.68400000
## F1Chl 0.13000000 23.77200000 36.09900000 34.99601172 46.63200000
## Chl201 30.72200000 48.36225000 56.52100000 52.60670000 58.57325000
## Chl103 31.47100000 52.16025000 55.50900000 52.59241667 57.46400000
## CGFlav 1.75800000 2.06200000 2.11500000 2.16945455 2.29050000
## F1Flav 1.05600000 1.80700000 1.97800000 1.96700279 2.12800000
## Flav201 1.45400000 1.56350000 1.63850000 1.71080000 1.86625000
## Flav103 1.29300000 1.46400000 1.55450000 1.59983333 1.74600000
## CGNBI 11.67000000 14.24000000 16.23000000 16.73909091 18.93000000
## F1NBI 0.07000000 12.04750000 18.52500000 18.18443080 24.31500000
## NBI201 14.37000000 26.11500000 34.42500000 31.68800000 36.59000000
## NBI103 23.77000000 30.49500000 33.40500000 33.14333333 35.07000000
## Max.
## CGAnth 0.69100000
## F1Anth 0.48300000
## Anth201 0.15600000
## Anth103 0.11400000
## CGChl 47.68200000
## F1Chl 59.90500000
## Chl201 59.75700000
## Chl103 58.84300000
## CGFlav 2.45800000
## F1Flav 2.86100000
## Flav201 2.13800000
## Flav103 2.11100000
## CGNBI 22.66000000
## F1NBI 49.17000000
## NBI201 40.97000000
## NBI103 44.88000000
#Boxplot Anthocyanin Allocation
AAnth <- ggplot(Data) + aes(x = Allocation, y = Anth) + geom_boxplot() +geom_hline(yintercept = mean(Data$Anth), color = "purple4") + ylab("Anthocyanin Measure") + xlab("Allocation") + ggtitle("Anthocyanin of Tree Allocation") + theme_classic()+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Boxplot Chlorophyll Allocation
AChl <- ggplot(Data) + aes(x = Allocation, y = Chl) + geom_boxplot() +geom_hline(yintercept = mean(Data$Chl), color = "purple4") + ylab("Chlorophyll Measure") + xlab("Allocation") + ggtitle("Chlorophyll of Tree Allocation") + theme_classic()+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Boxplot Flavanol Allocation
AFlav <- ggplot(Data) + aes(x = Allocation, y = Flav) + geom_boxplot() +geom_hline(yintercept = mean(Data$Flav), color = "purple4") + ylab("Flavanol Measure") + xlab("Allocation") + ggtitle("Flavonol of Tree Allocation") + theme_classic()+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Boxplot NBI Allocation
ANBI <- ggplot(Data) + aes(x = Allocation, y = NBI) + geom_boxplot() +geom_hline(yintercept = mean(Data$NBI), color = "purple4") + ylab("NBI Measure") + xlab("Allocation") + ggtitle("NBI of Tree Allocation") + theme_classic()+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Display Plots
grid.arrange(AAnth,AChl,AFlav,ANBI, ncol=2)
#Chlorophyll
mod5 <-lm(Data$Chl ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
##
## Response: Data$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 6742 2247.21 9.9149 1.748e-06 ***
## Residuals 1821 412728 226.65
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Nitrogen
mod6 <-lm(Data$NBI ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
##
## Response: Data$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 6742 2247.21 9.9149 1.748e-06 ***
## Residuals 1821 412728 226.65
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavanol
mod7 <-lm(Data$Flav ~ Data$Allocation)
anova(mod7)
## Analysis of Variance Table
##
## Response: Data$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 2.713 0.90423 14.755 1.708e-09 ***
## Residuals 1821 111.598 0.06128
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Anthocyanin
mod8 <-lm(Data$Anth ~ Data$Allocation)
anova(mod8)
## Analysis of Variance Table
##
## Response: Data$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 0.3040 0.101343 47.474 < 2.2e-16 ***
## Residuals 1821 3.8873 0.002135
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
F1 Samples (Approx 3 years) appear more similar to that of the Crimson Glory plant than either/both parents - this is possibly due to age effects as CG is likely more similar in this regard being shorter (No age confirmed). ANOVAs incidate there is significant differences between the allocations - this is to be expected.
#Binding parents into single dataset
Parent <- rbind(EC201,EC103)
Parent$No = c(1:22)
#Summary Stats
Parent2 = group_by(Parent, Tree.ID)
Parent2 = summarise(Parent2,Anth = mean(Anth, na.rm = T),Chl = mean(Chl, na.rm = T), Flav = mean(Flav, na.rm = T), NBI = mean(NBI, na.rm = T))
head(Parent2)
## # A tibble: 2 x 5
## Tree.ID Anth Chl Flav NBI
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 EC103 0.0588 52.6 1.60 33.1
## 2 EC201 0.0779 52.6 1.71 31.7
#Anthocyanin
ParAnth = summary(Parent$Anth)
#Chlorophyll
ParChl = summary(Parent$Chl)
#Flavonol
ParFlav = summary(Parent$Flav)
#NBI
ParNBI = summary(Parent$NBI)
as.table(rbind(ParAnth,ParChl,ParFlav,ParNBI))
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## ParAnth 0.004000 0.048250 0.058000 0.067500 0.086750 0.156000
## ParChl 30.722000 50.356750 55.739000 52.598909 57.794750 59.757000
## ParFlav 1.293000 1.475000 1.594000 1.650273 1.821000 2.138000
## ParNBI 14.370000 29.872500 34.025000 32.481818 35.892500 44.880000
#Anthocyanin Parent Plots
#Boxplot
plot5<- ggplot(Parent) + aes(x = Allocation, y = Anth ) + geom_boxplot() + ylab("Anthocyanin Measure") + xlab("Parent") + ggtitle("Anthocyanin of Parent Samples")+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Scatter
plot51<-ggplot(Parent) +aes(x = No, y = Anth) + geom_point() +geom_hline(yintercept = mean(Parent$Anth))+ ylab("Anthocyanin Measure") + xlab("Measure") + ggtitle("Anthocyanin of Parent Samples")
#Histogram
plot52 <-ggplot(Parent) +aes(Anth) +geom_histogram() + stat_bin(binwidth = 0.001) + ylab("Frequency") + xlab("Anthocyanin Measure") + ggtitle("Anthocyanin of Parent Samples")
grid.arrange(plot5,plot51,plot52)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin T.test
t.test(Parent$Anth ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$Anth by Parent$Tree.ID
## t = -1.2283, df = 19.107, p-value = 0.2342
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.05154327 0.01340994
## sample estimates:
## mean in group EC103 mean in group EC201
## 0.05883333 0.07790000
#Chlorophyll Parent Plots
#Boxplot
plot6<- ggplot(Parent) + aes(x = Allocation, y = Chl ) + geom_boxplot() + ylab("Chlorophyll Measure") + xlab("Parent") + ggtitle("Chlorophyll of Parent Samples")+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Scatter
plot61<-ggplot(Parent) +aes(x = No, y = Chl) + geom_point() +geom_hline(yintercept = mean(Parent$Chl))+ ylab("Chlorophyll Measure") + xlab("Measure") + ggtitle("Chlorophyll of Parent Samples")
#Histogram
plot62 <-ggplot(Parent) +aes(Chl) +geom_histogram() + stat_bin(binwidth = 2) + ylab("Frequency") + xlab("Chlorophyll Measure") + ggtitle("Chlorophyll of Parent Samples")
grid.arrange(plot6,plot61,plot62)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Chlorophyll T.test
t.test(Parent$Chl ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$Chl by Parent$Tree.ID
## t = -0.003842, df = 17.804, p-value = 0.997
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -7.830954 7.802387
## sample estimates:
## mean in group EC103 mean in group EC201
## 52.59242 52.60670
#Flavonol Parent Plots
#Boxplot
plot7<- ggplot(Parent) + aes(x = Allocation, y = Flav ) + geom_boxplot() + ylab("Flavonol Measure") + xlab("Parent") + ggtitle("Flavonol of Parent Samples")+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Scatter
plot71<-ggplot(Parent) +aes(x = No, y = Flav) + geom_point() +geom_hline(yintercept = mean(Parent$Flav))+ ylab("Flavonol Measure") + xlab("Measure") + ggtitle("Flavonol of Parent Samples")
#Histogram
plot72 <-ggplot(Parent) +aes(Flav) +geom_histogram() + stat_bin(binwidth = 0.0001) + ylab("Frequency") + xlab("Flavonol Measure") + ggtitle("Flavonol of Parent Samples")
grid.arrange(plot7,plot71,plot72)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin T.test
t.test(Parent$Flav ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$Flav by Parent$Tree.ID
## t = -1.141, df = 19.612, p-value = 0.2676
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.31409194 0.09215861
## sample estimates:
## mean in group EC103 mean in group EC201
## 1.599833 1.710800
#NBI Parent Plots
#Boxplot
plot8<- ggplot(Parent) + aes(x = Allocation, y = NBI ) + geom_boxplot() + ylab("NBI Measure") + xlab("Parent") + ggtitle("NBI of Parent Samples")+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Scatter
plot81<-ggplot(Parent) +aes(x = No, y = NBI) + geom_point() +geom_hline(yintercept = mean(Parent$NBI))+ ylab("NBI Measure") + xlab("Measure") + ggtitle("NBI of Parent Samples")
#Histogram
plot82 <-ggplot(Parent) +aes(NBI) +geom_histogram() + stat_bin(binwidth = 2) + ylab("Frequency") + xlab("NBI Measure") + ggtitle("NBI of Parent Samples")
grid.arrange(plot8,plot81,plot82)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin T.test
t.test(Parent$NBI ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$NBI by Parent$Tree.ID
## t = 0.47573, df = 14.7, p-value = 0.6413
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -5.076667 7.987334
## sample estimates:
## mean in group EC103 mean in group EC201
## 33.14333 31.68800
Interesting sample pattern here, Chl and NBI start low and work high, Flav does the opposite. Maybe accuracy of measurements?
Investigating measures across the F1 cross population
#Grouping F1 Measures By Tree
F12 <-group_by(F1,Tree.ID)
F12 <- summarise(F12,Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))
head(F12)
## # A tibble: 6 x 5
## Tree.ID Chl NBI Anth Flav
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 IN4BT 34.5 16.2 0.110 2.17
## 2 IN4BV 27.5 13.8 0.121 2.01
## 3 IN4BW 24.8 12.5 0.127 1.99
## 4 IN4BX 37.6 18.4 0.0905 2.05
## 5 IN4BY 24.2 12.5 0.110 1.98
## 6 IN4BZ 32.0 15.6 0.106 2.09
#Boxplot Anthocyanin F1
FAnth <- ggplot(F1) + aes(x = Tree.ID, y = Anth) + geom_boxplot() +geom_hline(yintercept = mean(F1$Anth), color = "purple4") + ylab("Anthocyanin Measure") + xlab("Tree ID") + ggtitle("Anthocyanin of F1 population") + theme_classic();FAnth
#Mean Measures Anthocyanin
FSAnth <- ggplot(F12) + aes(x = Tree.ID, y = Anth) + geom_point() +geom_hline(yintercept = mean(F12$Anth)) + ylab("Anthocyanin Measure") + xlab("Tree ID") + ggtitle("Anthocyanin of F1 population")
#Histogram of Anthocyanin Distribution
FHAnth <- ggplot(F1) + aes(x = Anth) + geom_histogram()
#Display Anthocyanin Plots
grid.arrange(FSAnth,FHAnth)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
FAA = lm(F1$Anth ~ F1$Tree.ID)
anova(FAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 0.5253 0.0033247 1.8093 2.001e-08 ***
## Residuals 1633 3.0007 0.0018376
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Chlorophyll F1
FChl <- ggplot(F1) + aes(x = Tree.ID, y = Chl) + geom_boxplot() +geom_hline(yintercept = mean(F1$Chl), color = "purple4") + ylab("Chlorophyll Measure") + xlab("Tree ID") + ggtitle("Chlorophyll of F1 Population") + theme_classic();FChl
#Mean Measures Chlorophyll
FSChl <- ggplot(F12) + aes(x = Tree.ID, y = Chl) + geom_point() +geom_hline(yintercept = mean(F12$Chl)) + ylab("Chlorophyll Measure") + xlab("Tree ID") + ggtitle("Chlorophyll of F1 population")
#Histogram of Chlorophyll
FHChl <- ggplot(F1) + aes(x = Chl) + geom_histogram()
#Display Chlorophyll Plots
grid.arrange(FSChl, FHChl)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Chlorophyll ANOVA
FCA = lm(F1$Chl ~ F1$Tree.ID)
anova(FCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 47130 298.29 1.3395 0.004474 **
## Residuals 1633 363634 222.68
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Flavanol F1
FFlav <- ggplot(F1) + aes(x = Tree.ID, y = Flav) + geom_boxplot() +geom_hline(yintercept = mean(F1$Flav), color = "purple4") + ylab("Flavanol Measure") + xlab("Tree ID") + ggtitle("Flavonol of F1 Population") + theme_classic();FFlav
#Mean Measures Flavonol
FSFlav <- ggplot(F12) + aes(x = Tree.ID, y = Flav) + geom_point() +geom_hline(yintercept = mean(F12$Flav)) + ylab("Flavonol Measure") + xlab("Tree ID") + ggtitle("Flavonol of F1 population")
#Histogram of Flavonol
FHFlav <- ggplot(F1) + aes(x = Flav) + geom_histogram()
#Display Chlorophyll Plots
grid.arrange(FSFlav, FHFlav)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Flavonol ANOVA
FFA = lm(F1$Flav ~ F1$Tree.ID)
anova(FFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 25.118 0.15897 3.0531 < 2.2e-16 ***
## Residuals 1633 85.030 0.05207
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot NBI F1
FNBI <- ggplot(F1) + aes(x = Tree.ID, y = NBI) + geom_boxplot() +geom_hline(yintercept = mean(F1$NBI), color = "purple4") + ylab("NBI Measure") + xlab("Tree ID") + ggtitle("NBI of F1 Population") + theme_classic();FNBI
#Mean Measures NBI
FSNBI <- ggplot(F12) + aes(x = Tree.ID, y = NBI) + geom_point() +geom_hline(yintercept = mean(F12$NBI)) + ylab("NBI Measure") + xlab("Tree ID") + ggtitle("NBI of F1 population")
#Histogram of NBI
FHNBI <- ggplot(F1) + aes(x = NBI) + geom_histogram()
#Display NBI Plots
grid.arrange(FSNBI, FHNBI)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#NBI ANOVA
FNA = lm(F1$NBI ~ F1$Tree.ID)
anova(FNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 16378 103.661 1.5147 8.435e-05 ***
## Residuals 1633 111761 68.439
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Msr = group_by(F1, Tree.ID, measure)
Msr = summarise(Msr, Anth = mean(Anth), Flav = mean(Flav), Chl = mean(Chl),NBI = mean(NBI))
#Select Random Column
#sample(1:4,10, replace = T)
#[1] 3 3 2 1 1 4 1 2 4 3
#Select Random Row
#sample(1:50,10, replace = T)
#[1] 34 37 44 20 44 47 9 19 22 40
#Col 3, Row 34 = IN4G5
IN4G5 = Msr[c(1432:1442),]
AnthG5 <-ggplot(IN4G5) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4G5$Anth))
ChlG5 <-ggplot(IN4G5) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4G5$Chl))
FlavG5 <-ggplot(IN4G5) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4G5$Flav))
NBIG5 <-ggplot(IN4G5) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4G5$NBI))
grid.arrange(AnthG5,ChlG5,FlavG5,NBIG5)
#Col 3, Row 37 = IN4EP
IN4EP = Msr[c(935:945),]
AnthEP <-ggplot(IN4EP) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4EP$Anth))
ChlEP <-ggplot(IN4EP) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4EP$Chl))
FlavEP <-ggplot(IN4EP) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4EP$Flav))
NBIEP <-ggplot(IN4EP) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4EP$NBI))
grid.arrange(AnthEP,ChlEP,FlavEP,NBIEP)
#Col 2, Row 44 = IN4EY
IN4EY = Msr[c(1012:1022),]
AnthEY <-ggplot(IN4EY) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4EY$Anth))
ChlEY <-ggplot(IN4EY) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4EY$Chl))
FlavEY <-ggplot(IN4EY) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4EY$Flav))
NBIEY <-ggplot(IN4EY) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4EY$NBI))
grid.arrange(AnthEY,ChlEY,FlavEY,NBIEY)
#Col 1, Row 20 = IN4CD
IN4CD = Msr[c(204:214),]
AnthCD <-ggplot(IN4CD) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4CD$Anth))
ChlCD <-ggplot(IN4CD) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4CD$Chl))
FlavCD <-ggplot(IN4CD) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4CD$Flav))
NBICD <-ggplot(IN4CD) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4CD$NBI))
grid.arrange(AnthCD,ChlCD,FlavCD,NBICD)
#Col 1, Row 44 = IN4D8
IN4D8 = Msr[c(463:472),]
AnthD8 <-ggplot(IN4D8) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4D8$Anth))
ChlD8 <-ggplot(IN4D8) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4D8$Chl))
FlavD8 <-ggplot(IN4D8) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4D8$Flav))
NBID8 <-ggplot(IN4D8) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4D8$NBI))
grid.arrange(AnthD8,ChlD8,FlavD8,NBID8)
#Col4, Row 47 = IN4GV
IN4GV = Msr[c(1645:1654),]
AnthGV <-ggplot(IN4GV) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4GV$Anth))
ChlGV <-ggplot(IN4GV) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4GV$Chl))
FlavGV <-ggplot(IN4GV) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4GV$Flav))
NBIGV <-ggplot(IN4GV) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4GV$NBI))
grid.arrange(AnthGV,ChlGV,FlavGV,NBIGV)
#Col 1, Row 9 = IN4C2
IN4C2 = Msr[c(93:103),]
AnthC2 <-ggplot(IN4C2) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4C2$Anth))
ChlC2 <-ggplot(IN4C2) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4C2$Chl))
FlavC2 <-ggplot(IN4C2) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4C2$Flav))
NBIC2 <-ggplot(IN4C2) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4C2$NBI))
grid.arrange(AnthC2,ChlC2,FlavC2,NBIC2)
#Col 2, Row 19 = IN4E3
IN4E3 = Msr[c(740:750),]
AnthE3 <-ggplot(IN4E3) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4E3$Anth))
ChlE3 <-ggplot(IN4E3) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4E3$Chl))
FlavE3 <-ggplot(IN4E3) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4E3$Flav))
NBIE3 <-ggplot(IN4E3) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4E3$NBI))
grid.arrange(AnthE3,ChlE3,FlavE3,NBIE3)
#Col 4, Row 22 = N/A -> Row 23 = IN4HK
IN4HK = Msr[c(1718:1728),]
AnthHK <-ggplot(IN4HK) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4HK$Anth))
ChlHK <-ggplot(IN4HK) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4HK$Chl))
FlavHK <-ggplot(IN4HK) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4HK$Flav))
NBIHK <-ggplot(IN4HK) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4HK$NBI))
grid.arrange(AnthHK,ChlHK,FlavHK,NBIHK)
#Col 3, Row 40 = IN4GC
IN4GC = Msr[c(1508:1518),]
AnthGC <-ggplot(IN4GC) + aes(x = measure, y = Anth) + geom_point() + geom_hline(yintercept = mean(IN4GC$Anth))
ChlGC <-ggplot(IN4GC) + aes(x = measure, y = Chl) + geom_point() + geom_hline(yintercept = mean(IN4GC$Chl))
FlavGC <-ggplot(IN4GC) + aes(x = measure, y = Flav) + geom_point() + geom_hline(yintercept = mean(IN4GC$Flav))
NBIGC <-ggplot(IN4GC) + aes(x = measure, y = NBI) + geom_point() + geom_hline(yintercept = mean(IN4GC$NBI))
grid.arrange(AnthGC,ChlGC,FlavGC,NBIGC)
F13 = group_by(F1,Height)
F13 = summarise(F13, Anth = mean(Anth, na.rm = T), Chl = mean(Chl, na.rm = T), Flav = mean(Flav, na.rm = T), NBI = mean(NBI, na.rm = T))
head(F13)
## # A tibble: 3 x 5
## Height Anth Chl Flav NBI
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 H 0.105 33.9 1.93 17.9
## 2 L 0.0968 35.6 1.98 18.5
## 3 M 0.0913 35.3 1.98 18.1
#Boxplot Anthocyanin Height
HAnth <- ggplot(F1) + aes(x = Height, y = Anth) + geom_boxplot() +geom_hline(yintercept = mean(F1$Anth), color = "purple4") + ylab("Anthocyanin Measure") + xlab("Height") + ggtitle("Anthocyanin of F1 population by Height") + theme_classic()+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Boxplot Chlorophyll F1
HChl <- ggplot(F1) + aes(x = Height, y = Chl) + geom_boxplot() +geom_hline(yintercept = mean(F1$Chl), color = "purple4") + ylab("Chlorophyll Measure") + xlab("Height") + ggtitle("Chlorophyll of F1 Population") + theme_classic() +stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Boxplot Flavanol F1
HFlav <- ggplot(F1) + aes(x = Height, y = Flav) + geom_boxplot() +geom_hline(yintercept = mean(F1$Flav), color = "purple4") + ylab("Flavanol Measure") + xlab("Height") + ggtitle("Flavonol of F1 Population by Height") + theme_classic() +stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Boxplot NBI F1
HNBI <- ggplot(F1) + aes(x = Height, y = NBI) + geom_boxplot() +geom_hline(yintercept = mean(F1$NBI), color = "purple4") + ylab("NBI Measure") + xlab("Height") + ggtitle("NBI of F1 Population") + theme_classic() +stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
grid.arrange(HAnth,HChl,HFlav,HNBI)
#Anthocyanin ANOVA
HAA = lm(F1$Anth ~ F1$Height)
anova(HAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.0526 0.0262759 13.533 1.468e-06 ***
## Residuals 1789 3.4735 0.0019416
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(HAA)
##
## Call:
## lm(formula = F1$Anth ~ F1$Height)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.10400 -0.02878 -0.00056 0.02666 0.37800
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.105002 0.001973 53.232 < 2e-16 ***
## F1$HeightL -0.008225 0.002622 -3.137 0.00173 **
## F1$HeightM -0.013666 0.002630 -5.197 2.26e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.04406 on 1789 degrees of freedom
## Multiple R-squared: 0.0149, Adjusted R-squared: 0.0138
## F-statistic: 13.53 on 2 and 1789 DF, p-value: 1.468e-06
#Chlorophyll ANOVA
HCA = lm(F1$Chl ~ F1$Height)
anova(HCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 853 426.30 1.8605 0.1559
## Residuals 1789 409911 229.13
#Flavonol ANOVA
HFA = lm(F1$Flav ~ F1$Height)
anova(HFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.915 0.45758 7.4943 0.0005739 ***
## Residuals 1789 109.232 0.06106
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#NBI ANOVA
HNA = lm(F1$NBI ~ F1$Height)
anova(HNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 100 50.044 0.6992 0.4971
## Residuals 1789 128039 71.570
#Grouping data by ROw
F1R = group_by(F1,Row)
F1R = summarise(F1R,Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))
head(F1R)
## # A tibble: 6 x 5
## Row Chl NBI Anth Flav
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 1 35.6 17.3 0.107 2.09
## 2 10 30.5 15.7 0.112 1.98
## 3 11 29.9 15.0 0.112 2.04
## 4 12 34.6 18.7 0.0968 1.84
## 5 13 31.3 17.5 0.107 1.86
## 6 14 35.0 17.9 0.0888 1.98
#Comparing Rows with Differing Tree Numbers
#1 Row with 2 Trees
R2 = F1R[c(9),]
#39 Rows with 3 Trees
R3 = F1R[-c(16,26,4,40,36,5,50,42,44,46,9),]
#10 Rows with 4 Trees
R4 = F1R[c(16,26,4,40,36,5,50,42,44,46),]
#Row Sample Summaries
summary(R2)
## Row Chl NBI Anth
## 17 :1 Min. :32.13 Min. :17.14 Min. :0.1163
## 0 :0 1st Qu.:32.13 1st Qu.:17.14 1st Qu.:0.1163
## 1 :0 Median :32.13 Median :17.14 Median :0.1163
## 10 :0 Mean :32.13 Mean :17.14 Mean :0.1163
## 11 :0 3rd Qu.:32.13 3rd Qu.:17.14 3rd Qu.:0.1163
## 12 :0 Max. :32.13 Max. :17.14 Max. :0.1163
## (Other):0
## Flav
## Min. :1.887
## 1st Qu.:1.887
## Median :1.887
## Mean :1.887
## 3rd Qu.:1.887
## Max. :1.887
##
summary(R3)
## Row Chl NBI Anth
## 1 : 1 Min. :29.19 Min. :14.38 Min. :0.07868
## 10 : 1 1st Qu.:32.02 1st Qu.:16.44 1st Qu.:0.08535
## 11 : 1 Median :34.38 Median :17.81 Median :0.09354
## 14 : 1 Mean :34.97 Mean :18.12 Mean :0.09677
## 15 : 1 3rd Qu.:37.05 3rd Qu.:19.46 3rd Qu.:0.10917
## 16 : 1 Max. :43.89 Max. :23.16 Max. :0.12239
## (Other):33
## Flav
## Min. :1.820
## 1st Qu.:1.931
## Median :1.974
## Mean :1.973
## 3rd Qu.:2.037
## Max. :2.092
##
summary(R4)
## Row Chl NBI Anth
## 12 :1 Min. :31.33 Min. :16.99 Min. :0.08183
## 13 :1 1st Qu.:34.20 1st Qu.:17.74 1st Qu.:0.09326
## 23 :1 Median :35.08 Median :18.29 Median :0.09747
## 32 :1 Mean :35.09 Mean :18.48 Mean :0.09702
## 41 :1 3rd Qu.:36.36 3rd Qu.:19.10 3rd Qu.:0.10265
## 45 :1 Max. :38.42 Max. :20.71 Max. :0.10721
## (Other):4
## Flav
## Min. :1.839
## 1st Qu.:1.898
## Median :1.944
## Mean :1.941
## 3rd Qu.:1.995
## Max. :2.032
##
#Checking Variance (R2 discounted due to sample size of 1 row)
var(R3$Anth)
## [1] 0.0001562666
var(R4$Anth)
## [1] 6.039853e-05
var(R3$Chl)
## [1] 14.76679
var(R4$Chl)
## [1] 4.10476
var(R3$Flav)
## [1] 0.004848629
var(R4$Flav)
## [1] 0.004125519
var(R3$NBI)
## [1] 5.602987
var(R4$NBI)
## [1] 1.155704
#T.test
t.test(R4$Anth, R3$Anth, alternative = "two.sided", var.equal = FALSE)
##
## Welch Two Sample t-test
##
## data: R4$Anth and R3$Anth
## t = 0.081174, df = 22.551, p-value = 0.936
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.006306855 0.006821440
## sample estimates:
## mean of x mean of y
## 0.09702315 0.09676586
t.test(R4$Chl, R3$Chl, alternative = "two.sided", var.equal = FALSE)
##
## Welch Two Sample t-test
##
## data: R4$Chl and R3$Chl
## t = 0.13309, df = 27.683, p-value = 0.8951
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1.702350 1.938809
## sample estimates:
## mean of x mean of y
## 35.08876 34.97053
t.test(R4$Flav, R3$Flav, alternative = "two.sided", var.equal = FALSE)
##
## Welch Two Sample t-test
##
## data: R4$Flav and R3$Flav
## t = -1.3877, df = 14.921, p-value = 0.1856
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.08156262 0.01725693
## sample estimates:
## mean of x mean of y
## 1.941185 1.973338
t.test(R4$Flav, R3$Flav, alternative = "two.sided", var.equal = FALSE)
##
## Welch Two Sample t-test
##
## data: R4$Flav and R3$Flav
## t = -1.3877, df = 14.921, p-value = 0.1856
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.08156262 0.01725693
## sample estimates:
## mean of x mean of y
## 1.941185 1.973338
There appears to be no signficant differences between Rows with 3 trees and rows with 4 trees for any of the measures.
#Boxplot Anthocyanin Row
RoAnth <- ggplot(F1) + aes(x = Row, y = Anth) + geom_boxplot() +geom_hline(yintercept = mean(F1$Anth), color = "purple4") + ylab("Anthocyanin Measure") + xlab("Row") + ggtitle("Anthocyanin of F1 population by Row") + theme_classic();RoAnth
#Mean Anthocyanin Row Plot
SRoAnth <- ggplot(F1R) + aes(x = as.numeric(Row), y = Anth) + geom_point() +geom_hline(yintercept = mean(F1R$Anth)) + ylab("Anthocyanin Measure") + xlab("Row") + ggtitle("Mean Anthocyanin of F1 population by Row") + theme_classic()
#Histogram of Anthocyanin
RoHAnth <- ggplot(F1R) + aes(x = Anth) + geom_histogram()
#Display plots
grid.arrange(SRoAnth,RoHAnth)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoAA = lm(F1$Anth ~ F1$Row)
anova(RoAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 0.2346 0.0047878 2.5339 4.261e-08 ***
## Residuals 1742 3.2914 0.0018895
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Chlorophyll F1
RoChl <- ggplot(F1) + aes(x = Row, y = Chl) + geom_boxplot() +geom_hline(yintercept = mean(F1$Chl), color = "purple4") + ylab("Chlorophyll Measure") + xlab("Row") + ggtitle("Chlorophyll of F1 Population by Row") + theme_classic();RoChl
#Mean Chlorophyll Row Plot
SRoChl <- ggplot(F1R) + aes(x = as.numeric(Row), y = Chl) + geom_point() +geom_hline(yintercept = mean(F1R$Chl)) + ylab("Chlorophyll Measure") + xlab("Row") + ggtitle("Mean Chl of F1 population by Row") + theme_classic()
#Histogram of Chlorophyll
RoHChl <- ggplot(F1R) + aes(x = Chl) + geom_histogram()
#Display plots
grid.arrange(SRoChl,RoHChl)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoCA = lm(F1$Chl ~ F1$Row)
anova(RoCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 21394 436.61 1.9533 0.0001046 ***
## Residuals 1742 389370 223.52
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Flavanol F1
RoFlav <- ggplot(F1) + aes(x = Row, y = Flav) + geom_boxplot() +geom_hline(yintercept = mean(F1$Flav), color = "purple4") + ylab("Flavanol Measure") + xlab("Row") + ggtitle("Flavonol of F1 Population by Row") + theme_classic();RoFlav
#Mean Flavonol Row Plot
SRoFlav <- ggplot(F1R) + aes(x = as.numeric(Row), y = Flav) + geom_point() +geom_hline(yintercept = mean(F1R$Flav)) + ylab("Flavonol Measure") + xlab("Row") + ggtitle("Mean Flavonol of F1 population by Row") + theme_classic()
#Histogram of Flavonol
RoHFlav <- ggplot(F1R) + aes(x = Flav) + geom_histogram()
#Display plots
grid.arrange(SRoFlav,RoHFlav)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoFA = lm(F1$Flav ~ F1$Row)
anova(RoFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 8.215 0.167646 2.865 3.11e-10 ***
## Residuals 1742 101.933 0.058515
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot NBI F1
RoNBI <- ggplot(F1) + aes(x = Row, y = NBI) + geom_boxplot() +geom_hline(yintercept = mean(F1$NBI), color = "purple4") + ylab("NBI Measure") + xlab("Row") + ggtitle("NBI of F1 Population by Row") + theme_classic();RoNBI
#Mean NBI Row Plot
SRoNBI <- ggplot(F1R) + aes(x = as.numeric(Row), y = NBI) + geom_point() +geom_hline(yintercept = mean(F1R$NBI)) + ylab("NBI Measure") + xlab("Row") + ggtitle("Mean NBI of F1 population by Row") + theme_classic()
#Histogram of NBI
RoHNBI <- ggplot(F1R) + aes(x = NBI) + geom_histogram()
#Display plots
grid.arrange(SRoNBI,RoHNBI)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoNA = lm(F1$NBI ~ F1$Row)
anova(RoNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 7866 160.527 2.325 8.14e-07 ***
## Residuals 1742 120273 69.043
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Making Column Values Factors
F1$Column = as.factor(F1$Column)
#Grouping data by Column
F1C = group_by(F1,Column)
F1C = summarise(F1C,Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))
head(F1C)
## # A tibble: 4 x 5
## Column Chl NBI Anth Flav
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 1 33.8 17.2 0.0945 2.01
## 2 2 35.4 18.6 0.0992 1.94
## 3 3 36.0 18.7 0.0990 1.96
## 4 4 34.3 18.7 0.0912 1.88
#Boxplot Anthocyanin Height
CAnth <- ggplot(F1) + aes(x = Column, y = Anth) + geom_boxplot() +geom_hline(yintercept = mean(F1$Anth)) + ylab("Anthocyanin Measure") + xlab("Column") + ggtitle("Anthocyanin of F1 population by Column") + theme_classic() +stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Anthocyanin ANOVA
CAA = lm(F1$Anth ~ F1$Column)
anova(CAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 0.0122 0.0040655 2.0687 0.1024
## Residuals 1788 3.5138 0.0019652
#Boxplot Chlorophyll F1
CChl <- ggplot(F1) + aes(x = Column, y = Chl) + geom_boxplot() +geom_hline(yintercept = mean(F1$Chl), color = "purple4") + ylab("Chlorophyll Measure") + xlab("Column") + ggtitle("Chlorophyll of F1 Population by Column") + theme_classic()+stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Chlorophyll ANOVA
CCA = lm(F1$Chl ~ F1$Column)
anova(CCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 1586 528.66 2.3101 0.07453 .
## Residuals 1788 409178 228.85
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Flavanol F1
CFlav <- ggplot(F1) + aes(x = Column, y = Flav) + geom_boxplot() +geom_hline(yintercept = mean(F1$Flav), color = "purple4") + ylab("Flavanol Measure") + xlab("Column") + ggtitle("Flavonol of F1 Population by Column") + theme_classic() +stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#Flavonol ANOVA
CFA = lm(F1$Flav ~ F1$Column)
anova(CFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 2.305 0.76823 12.737 3.087e-08 ***
## Residuals 1788 107.843 0.06031
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot NBI F1
CNBI <- ggplot(F1) + aes(x = Column, y = NBI) + geom_boxplot() +geom_hline(yintercept = mean(F1$NBI), color = "purple4") + ylab("NBI Measure") + xlab("Column") + ggtitle("NBI of F1 Population by Column") + theme_classic() +stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3)
#NBI ANOVA
CNA = lm(F1$NBI ~ F1$Column)
anova(CNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 821 273.626 3.8427 0.009333 **
## Residuals 1788 127318 71.207
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
grid.arrange(CAnth,CChl,CFlav,CNBI)
#Anthocyanin
CRHA = lm(F1$Anth ~ F1$Height*F1$Column*F1$Row)
anova(CRHA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.05255 0.0262759 14.9537 3.788e-07 ***
## F1$Column 3 0.01228 0.0040942 2.3300 0.0727244 .
## F1$Row 49 0.23127 0.0047199 2.6861 6.175e-09 ***
## F1$Height:F1$Column 6 0.02055 0.0034247 1.9490 0.0699958 .
## F1$Height:F1$Row 98 0.20024 0.0020433 1.1628 0.1394606
## F1$Column:F1$Row 106 0.28473 0.0026861 1.5287 0.0006952 ***
## F1$Height:F1$Column:F1$Row 212 0.41375 0.0019517 1.1107 0.1490621
## Residuals 1315 2.31066 0.0017572
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Remove insignificant variables
CRHA2 = lm(F1$Anth ~ F1$Height*F1$Row)
anova(CRHA2)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.05255 0.0262759 14.2135 7.586e-07 ***
## F1$Row 49 0.23404 0.0047763 2.5837 2.178e-08 ***
## F1$Height:F1$Row 98 0.20394 0.0020810 1.1257 0.1942
## Residuals 1642 3.03551 0.0018487
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Chlorophyll
CRHC = lm(F1$Chl ~ F1$Height*F1$Column*F1$Row)
anova(CRHC)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 853 426.30 2.0422 0.130152
## F1$Column 3 1577 525.57 2.5178 0.056677 .
## F1$Row 49 21813 445.16 2.1326 1.244e-05 ***
## F1$Height:F1$Column 6 1282 213.61 1.0233 0.408244
## F1$Height:F1$Row 98 27033 275.85 1.3215 0.022708 *
## F1$Column:F1$Row 106 24037 226.77 1.0863 0.265386
## F1$Height:F1$Column:F1$Row 212 59670 281.46 1.3484 0.001427 **
## Residuals 1315 274499 208.74
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Remove insignificant variables
CRHC2 = lm(F1$Chl ~ F1$Height*F1$Row)
anova(CRHC2)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 853 426.30 1.9372 0.14444
## F1$Row 49 21279 434.27 1.9734 8.34e-05 ***
## F1$Height:F1$Row 98 27286 278.43 1.2652 0.04464 *
## Residuals 1642 361346 220.06
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Further Remove insignificant variables
CRHC3 = lm(F1$Chl ~ F1$Row)
anova(CRHC3)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 21394 436.61 1.9533 0.0001046 ***
## Residuals 1742 389370 223.52
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavonol
CRHF = lm(F1$Flav ~ F1$Height*F1$Column*F1$Row)
anova(CRHF)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.915 0.45758 9.3660 9.143e-05 ***
## F1$Column 3 2.323 0.77447 15.8523 3.957e-10 ***
## F1$Row 49 8.139 0.16611 3.4001 1.213e-13 ***
## F1$Height:F1$Column 6 1.004 0.16728 3.4240 0.002334 **
## F1$Height:F1$Row 98 5.743 0.05860 1.1995 0.096365 .
## F1$Column:F1$Row 106 14.790 0.13953 2.8559 < 2.2e-16 ***
## F1$Height:F1$Column:F1$Row 212 12.988 0.06126 1.2540 0.012358 *
## Residuals 1315 64.245 0.04886
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#NBI
CRHN = lm(F1$NBI ~ F1$Height*F1$Column*F1$Row)
anova(CRHN)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 100 50.044 0.7850 0.4563286
## F1$Column 3 818 272.802 4.2793 0.0051365 **
## F1$Row 49 7816 159.511 2.5021 8.551e-08 ***
## F1$Height:F1$Column 6 792 132.004 2.0707 0.0539220 .
## F1$Height:F1$Row 98 8175 83.418 1.3085 0.0268723 *
## F1$Column:F1$Row 106 7765 73.250 1.1490 0.1510179
## F1$Height:F1$Column:F1$Row 212 18842 88.877 1.3942 0.0004396 ***
## Residuals 1315 83831 63.750
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Remove insignificant variables
CRHM2 = lm(F1$NBI ~ F1$Row*F1$Column)
anova(CRHM2)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 7866 160.527 2.3456 6.383e-07 ***
## F1$Column 3 789 263.021 3.8432 0.00934 **
## F1$Row:F1$Column 106 7724 72.864 1.0647 0.31303
## Residuals 1633 111761 68.439
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Controlling for Height,Column,Row effects
Dat = F1
#Total Mean
Dat$ATmean = mean(Dat$Anth)
Dat$CTmean = mean(Dat$Chl)
Dat$FTmean = mean(Dat$Flav)
Dat$NTmean = mean(Dat$NBI)
#Remove Total Mean
Dat$Anth2 = Dat$Anth - Dat$ATmean
Dat$Chl2 = Dat$Chl - Dat$CTmean
Dat$Flav2 = Dat$Flav - Dat$FTmean
Dat$NBI2 = Dat$NBI - Dat$NTmean
#Height Mean
DatH = group_by(Dat, Height)
DatH = summarise(DatH, HAnth = mean(Anth, na.rm = T), HFlav = mean(Flav,na.rm = T))
#Add Height Mean to Data
Dat =merge(Dat, DatH, by.x = "Height")
#Calculate Height Mean Deviation from Total Mean
Dat$ATH <- Dat$ATmean - Dat$HAnth
Dat$FTH = Dat$FTmean - Dat$HFlav
#Controlling for Height Anth and Flav
Dat$Anth3 = Dat$Anth2 + Dat$ATH
Dat$Flav3 = Dat$Flav2 + Dat$FTH
#Column Mean
DatC = group_by(Dat, Column)
DatC = summarise(DatC, CFlav = mean(Flav,na.rm = T), CNBI = mean(NBI,na.rm = T))
#Add Height Mean to Data
Dat =merge(Dat, DatC, by.x = "Column")
#Calculate Height Mean Deviation from Total Mean
Dat$FTH = Dat$FTmean - Dat$CFlav
Dat$NTH = Dat$NTmean - Dat$CNBI
#Controlling for Column Flav and NBI
Dat$Flav4 = Dat$Flav3 + Dat$FTH
Dat$NBI3 = Dat$NBI2 + Dat$NTH
#Row Mean
DatR = group_by(Dat, Row)
DatR = summarise(DatR, RAnth = mean(Anth,na.rm = T),RChl = mean(Chl,na.rm = T), RFlav = mean(Flav,na.rm = T), RNBI = mean(NBI,na.rm = T))
#Add Row Mean to Data
Dat =merge(Dat, DatR, by.x = "Row")
#Calculate Row Mean Deviation from Total Mean
Dat$ATR = Dat$ATmean - Dat$RAnth
Dat$CTR = Dat$CTmean - Dat$RChl
Dat$FTR = Dat$FTmean - Dat$RFlav
Dat$NTR = Dat$NTmean - Dat$RNBI
#Controlling for Row in Anth, Chl, Flav and NBI
Dat$Anth4 = Dat$Anth3 + Dat$ATR
Dat$Chl3 = Dat$Chl2 + Dat$CTR
Dat$Flav5 = Dat$Flav4 + Dat$FTR
Dat$NBI4 = Dat$NBI3 + Dat$NTR
#Anova Checks
AnAnth = lm(Dat$Anth4 ~ Dat$Height*Dat$Column*Dat$Row)
anova(AnAnth)
## Analysis of Variance Table
##
## Response: Dat$Anth4
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Height 2 0.00000 0.0000012 0.0007 0.9993236
## Dat$Column 3 0.00900 0.0029994 1.7070 0.1637135
## Dat$Row 49 0.00061 0.0000125 0.0071 1.0000000
## Dat$Height:Dat$Column 6 0.02055 0.0034247 1.9490 0.0699958 .
## Dat$Height:Dat$Row 98 0.20024 0.0020433 1.1628 0.1394606
## Dat$Column:Dat$Row 106 0.28473 0.0026861 1.5287 0.0006952 ***
## Dat$Height:Dat$Column:Dat$Row 212 0.41375 0.0019517 1.1107 0.1490621
## Residuals 1315 2.31066 0.0017572
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AnChl = lm(Dat$Chl3 ~ Dat$Height*Dat$Column*Dat$Row)
anova(AnChl)
## Analysis of Variance Table
##
## Response: Dat$Chl3
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Height 2 737 368.65 1.7660 0.171413
## Dat$Column 3 1956 652.10 3.1239 0.025073 *
## Dat$Row 49 155 3.17 0.0152 1.000000
## Dat$Height:Dat$Column 6 1282 213.61 1.0233 0.408244
## Dat$Height:Dat$Row 98 27033 275.85 1.3215 0.022708 *
## Dat$Column:Dat$Row 106 24037 226.77 1.0863 0.265386
## Dat$Height:Dat$Column:Dat$Row 212 59670 281.46 1.3484 0.001427 **
## Residuals 1315 274499 208.74
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AnFlav = lm(Dat$Flav5 ~ Dat$Height*Dat$Column*Dat$Row)
anova(AnFlav)
## Analysis of Variance Table
##
## Response: Dat$Flav5
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Height 2 0.001 0.000491 0.0101 0.989993
## Dat$Column 3 0.012 0.004029 0.0825 0.969582
## Dat$Row 49 0.215 0.004387 0.0898 1.000000
## Dat$Height:Dat$Column 6 1.004 0.167281 3.4240 0.002334 **
## Dat$Height:Dat$Row 98 5.743 0.058602 1.1995 0.096365 .
## Dat$Column:Dat$Row 106 14.790 0.139527 2.8559 < 2.2e-16 ***
## Dat$Height:Dat$Column:Dat$Row 212 12.988 0.061264 1.2540 0.012358 *
## Residuals 1315 64.245 0.048855
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AnNBI = lm(Dat$NBI4 ~ Dat$Height*Dat$Column*Dat$Row)
anova(AnNBI)
## Analysis of Variance Table
##
## Response: Dat$NBI4
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Height 2 80 39.936 0.6264 0.5346458
## Dat$Column 3 50 16.555 0.2597 0.8544529
## Dat$Row 49 22 0.451 0.0071 1.0000000
## Dat$Height:Dat$Column 6 792 132.004 2.0707 0.0539220 .
## Dat$Height:Dat$Row 98 8175 83.418 1.3085 0.0268723 *
## Dat$Column:Dat$Row 106 7765 73.250 1.1490 0.1510179
## Dat$Height:Dat$Column:Dat$Row 212 18842 88.877 1.3942 0.0004396 ***
## Residuals 1315 83831 63.750
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#New Heatmaps
#DatHM = group_by(Dat, Column, Row)
#DatHM = summarise(DatHM, Anth = mean(Anth4,na.rm = T), Chl = mean(Chl3,na.rm = T), Flav = mean(Flav5,na.rm = T), NBI = mean(NBI4,na.rm = T))
#write.xlsx(as.data.frame(DatHM), file = "DatHM.xlsx", sheetName ="Dat",col.names = T, row.names = F)
#Anthocyanin Heatmaps
AnthDoc <-read.xlsx("Anth.xlsx", sheetName = "Anth")
heatmaply(AnthDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "Anth Before Correction")
AnthDoc2 <-read.xlsx("DatHM2.xlsx", sheetName = "Anth")
heatmaply(AnthDoc2, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "Anth After Correction")
#Chlorophyll Heatmaps
ChlDoc<-read.xlsx("Chl.xlsx", sheetName = "Chl")
heatmaply(ChlDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "Chl Before Correction")
ChlDoc2 <-read.xlsx("DatHM2.xlsx", sheetName = "Chl")
heatmaply(ChlDoc2, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "Chl After Correction")
#Flavonol Heatmaps
FlavDoc<-read.xlsx("Flav.xlsx", sheetName = "Flav")
heatmaply(FlavDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "Flav Before Correction")
FlavDoc2 <-read.xlsx("DatHM2.xlsx", sheetName = "Flav")
heatmaply(FlavDoc2, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "Flav After Correction")
#NBI Heatmaps
NBIDoc<-read.xlsx("NBI.xlsx", sheetName = "NBI")
heatmaply(NBIDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "NBI Before Correction")
NBIDoc2 <-read.xlsx("DatHM2.xlsx", sheetName = "NBI")
heatmaply(NBIDoc2, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE, main = "NBI After Correction")
DatC = group_by(Dat, Tree.ID)
DatC = summarise(DatC, Anth = mean(Anth4,na.rm = T), Chl = mean(Chl3,na.rm = T), Flav = mean(Flav5,na.rm = T), NBI = mean(NBI4,na.rm = T))
#Anthocyanin
CAM = mean(Dat$Anth4)
#Boxplot
Cplot1 <-ggplot(Dat) +aes(x = Tree.ID, y = Anth4) + geom_boxplot()+ ylab("Anth Measure") + xlab("Tree ID") + ggtitle("Anth of F1 after Corrections")+geom_hline(yintercept = CAM)
Cplot11 <-ggplot(DatC) +aes(Anth) +geom_histogram() + stat_bin(binwidth = 0.001) + ylab("Frequency") + xlab("Anth Measure") + ggtitle("Anth of F1 after Corrections")
grid.arrange(Cplot1,Cplot11)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Previous distribution
grid.arrange(FAnth,FHAnth)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Column Compare
Cplot12 <-ggplot(Dat) +aes(x = Column, y = Anth4) + geom_boxplot()+ ylab("Anth Measure") + xlab("Tree ID") + ggtitle("Anth of F1 after Corrections")+geom_hline(yintercept = CAM);Cplot12
#Previous distribution comparison
grid.arrange(CAnth,Cplot12, ncol = 2)
# Row Compare
RoAnth
Cplot13 <-ggplot(Dat) +aes(x = Row, y = Anth4) + geom_boxplot()+ ylab("Anth Measure") + xlab("Row") + ggtitle("Anth of F1 after Corrections")+geom_hline(yintercept = CAM);Cplot13
#Height Compare
Cplot14 <-ggplot(Dat) +aes(x = Height, y = Anth4) + geom_boxplot()+ ylab("Anth Measure") + xlab("Height") + ggtitle("Anth of F1 after Corrections")+geom_hline(yintercept = CAM)
grid.arrange(HAnth,Cplot14,ncol=2)
#Chlorophyll
CCM = mean(Dat$Chl3)
#Boxplot
Cplot2 <-ggplot(Dat) +aes(x = Tree.ID, y = Chl3) + geom_boxplot()+ ylab("Chl Measure") + xlab("Tree ID") + ggtitle("Chl of F1 after Corrections")+geom_hline(yintercept = CCM)
#Histogram
Cplot21 <-ggplot(DatC) +aes(Chl) +geom_histogram() + stat_bin(binwidth = 0.01) + ylab("Frequency") + xlab("Chl Measure") + ggtitle("Chl of F1 after Corrections")
grid.arrange(Cplot2,Cplot21)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Previous Distribution
grid.arrange(FChl,FHChl)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Column Compare
Cplot22 <-ggplot(Dat) +aes(x = Column, y = Chl3) + geom_boxplot()+ ylab("Chl Measure") + xlab("Column") + ggtitle("Chl of F1 after Corrections")+geom_hline(yintercept = CAM)
#Previous distribution
grid.arrange(CChl,Cplot22, ncol = 2)
# Row Compare
RoChl
Cplot23 <-ggplot(Dat) +aes(x = Row, y = Chl3) + geom_boxplot()+ ylab("Chl Measure") + xlab("Row") + ggtitle("Chl of F1 after Corrections")+geom_hline(yintercept = CAM);Cplot23
#Height Compare
Cplot24 <-ggplot(Dat) +aes(x = Height, y = Chl3) + geom_boxplot()+ ylab("Chl Measure") + xlab("Height") + ggtitle("Chl of F1 after Corrections")+geom_hline(yintercept = CCM)
grid.arrange(HChl,Cplot24,ncol=2)
#Flavonol
CFM = mean(Dat$Flav5)
#Boxplot
Cplot3 <-ggplot(Dat) +aes(x = Tree.ID, y = Flav5) + geom_boxplot()+ ylab("Flav Measure") + xlab("Tree ID") + ggtitle("Flav of F1 after Corrections"+geom_hline(yintercept = CFM,color = "purple4"))
#Histogram
Cplot31 <-ggplot(DatC) +aes(Flav) +geom_histogram() + stat_bin(binwidth = 0.001) + ylab("Frequency") + xlab("Flav Measure") + ggtitle("Flav of F1 after Corrections")
grid.arrange(Cplot3,Cplot31)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Previous Distribution
grid.arrange(FFlav,FHFlav)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Column Compare
Cplot32 <-ggplot(Dat) +aes(x = Column, y = Flav5) + geom_boxplot()+ ylab("Flav Measure") + xlab("Column") + ggtitle("Flav of F1 after Corrections")+geom_hline(yintercept = CFM)
#Previous distribution
grid.arrange(CFlav,Cplot32, ncol = 2)
# Row Compare
RoFlav
Cplot33 <-ggplot(Dat) +aes(x = Row, y = Flav5) + geom_boxplot()+ ylab("Flav Measure") + xlab("Row") + ggtitle("Flav of F1 after Corrections")+geom_hline(yintercept = CFM);Cplot33
#Height Compare
Cplot34 <-ggplot(Dat) +aes(x = Height, y = Anth4) + geom_boxplot()+ ylab("Anth Measure") + xlab("Height") + ggtitle("Flav of F1 after Corrections")+geom_hline(yintercept = CFM)
grid.arrange(HFlav,Cplot34,ncol=2)
#NBI
CNM = mean(Dat$NBI4)
#Boxplot
Cplot4 <-ggplot(Dat) +aes(x = Tree.ID, y = NBI4) + geom_boxplot()+ ylab("NBI Measure") + xlab("Tree ID") + ggtitle("NBI of F1 after Corrections")+geom_hline(yintercept = CNM)
#Histogram
Cplot41 <-ggplot(DatC) +aes(NBI) +geom_histogram() + stat_bin(binwidth = 0.001) + ylab("Frequency") + xlab("NBI Measure") + ggtitle("NBI of F1 after Corrections")
grid.arrange(Cplot4,Cplot41)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Previous Distribution
grid.arrange(FNBI,FHNBI)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Column Compare
Cplot42 <-ggplot(Dat) +aes(x = Column, y = NBI4) + geom_boxplot()+ ylab("NBI Measure") + xlab("Column") + ggtitle("NBI of F1 after Corrections")+geom_hline(yintercept = CNM)
#Previous distribution
grid.arrange(CNBI,Cplot42, ncol = 2)
# Row Compare
RoNBI
Cplot43 <-ggplot(Dat) +aes(x = Row, y = NBI4) + geom_boxplot()+ ylab("NBI Measure") + xlab("Row") + ggtitle("NBI of F1 after Corrections")+geom_hline(yintercept = CNM);Cplot43
#Height Compare
Cplot44 <-ggplot(Dat) +aes(x = Height, y = NBI4) + geom_boxplot()+ ylab("NBI Measure") + xlab("Height") + ggtitle("NBI of F1 after Corrections")+geom_hline(yintercept = CNM)
grid.arrange(HNBI,Cplot44,ncol=2)
Comparing correlations between the 4 dualex measures
plot9 <-ggplot(Dat) + aes(x = Anth4, y = Chl3) + geom_point()
plot10 <-ggplot(Dat) + aes(x = Anth4, y = Flav5) + geom_point()
plot11<-ggplot(Dat) + aes(x = Anth4, y = NBI4) + geom_point()
plot12<-ggplot(Dat) + aes(x = Chl3, y = Flav5) + geom_point()
plot13<-ggplot(Dat) + aes(x = Chl3, y = NBI4) + geom_point()
plot14<-ggplot(Dat) + aes(x = Flav5, y = NBI4) + geom_point()
grid.arrange(plot9,plot10,plot11,plot12,plot13,plot14)
AnthComp = lm(Anth4 ~ Chl3*Flav5*NBI4, data = Dat)
anova(AnthComp)
## Analysis of Variance Table
##
## Response: Anth4
## Df Sum Sq Mean Sq F value Pr(>F)
## Chl3 1 0.30271 0.302706 192.4807 < 2.2e-16 ***
## Flav5 1 0.05792 0.057917 36.8277 1.572e-09 ***
## NBI4 1 0.01331 0.013306 8.4608 0.0036737 **
## Chl3:Flav5 1 0.02196 0.021955 13.9607 0.0001925 ***
## Chl3:NBI4 1 0.03008 0.030085 19.1299 1.292e-05 ***
## Flav5:NBI4 1 0.00791 0.007905 5.0266 0.0250834 *
## Chl3:Flav5:NBI4 1 0.00005 0.000055 0.0348 0.8519736
## Residuals 1784 2.80562 0.001573
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ChlComp = lm(Chl3 ~ Anth4*Flav5*NBI4, data = Dat)
anova(ChlComp)
## Analysis of Variance Table
##
## Response: Chl3
## Df Sum Sq Mean Sq F value Pr(>F)
## Anth4 1 36383 36383 1.9357e+04 < 2.2e-16 ***
## Flav5 1 383 383 2.0354e+02 < 2.2e-16 ***
## NBI4 1 342014 342014 1.8196e+05 < 2.2e-16 ***
## Anth4:Flav5 1 569 569 3.0285e+02 < 2.2e-16 ***
## Anth4:NBI4 1 115 115 6.1416e+01 7.879e-15 ***
## Flav5:NBI4 1 6552 6552 3.4859e+03 < 2.2e-16 ***
## Anth4:Flav5:NBI4 1 1 1 3.2830e-01 0.5667
## Residuals 1784 3353 2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
FlavComp = lm(Flav5 ~ Anth4*Chl3*NBI4, data = Dat)
anova(FlavComp)
## Analysis of Variance Table
##
## Response: Flav5
## Df Sum Sq Mean Sq F value Pr(>F)
## Anth4 1 2.455 2.455 198.4244 < 2.2e-16 ***
## Chl3 1 0.105 0.105 8.4580 0.003679 **
## NBI4 1 73.486 73.486 5940.1653 < 2.2e-16 ***
## Anth4:Chl3 1 0.438 0.438 35.4071 3.213e-09 ***
## Anth4:NBI4 1 0.121 0.121 9.7847 0.001788 **
## Chl3:NBI4 1 0.295 0.295 23.8417 1.139e-06 ***
## Anth4:Chl3:NBI4 1 0.028 0.028 2.2925 0.130175
## Residuals 1784 22.070 0.012
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
NBIComp = lm(NBI4 ~ Anth4*Chl3*Flav5, data = Dat)
anova(NBIComp)
## Analysis of Variance Table
##
## Response: NBI4
## Df Sum Sq Mean Sq F value Pr(>F)
## Anth4 1 12013 12013 1.5967e+04 < 2.2e-16 ***
## Chl3 1 95398 95398 1.2679e+05 < 2.2e-16 ***
## Flav5 1 9255 9255 1.2300e+04 < 2.2e-16 ***
## Anth4:Chl3 1 36 36 4.7348e+01 8.199e-12 ***
## Anth4:Flav5 1 118 118 1.5676e+02 < 2.2e-16 ***
## Chl3:Flav5 1 1393 1393 1.8521e+03 < 2.2e-16 ***
## Anth4:Chl3:Flav5 1 1 1 1.6591e+00 0.1979
## Residuals 1784 1342 1
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Plots Flowering vs Non-Flowering
plot39<- ggplot(Dat) + aes(x = Flower, y = Anth4) + geom_boxplot()
plot40<- ggplot(Dat) + aes(x = Flower, y = Chl3) + geom_boxplot()
plot41<- ggplot(Dat) + aes(x = Flower, y = Flav5) + geom_boxplot()
plot42<- ggplot(Dat) + aes(x = Flower, y = NBI4) + geom_boxplot()
grid.arrange(plot39,plot40,plot41,plot42)
AF<- lm(Dat$Anth4 ~ Dat$Flower)
anova(AF)
## Analysis of Variance Table
##
## Response: Dat$Anth4
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Flower 1 0.0002 0.00023977 0.1325 0.7159
## Residuals 1790 3.2393 0.00180967
CF<- lm(Dat$Chl3 ~ Dat$Flower)
anova(CF)
## Analysis of Variance Table
##
## Response: Dat$Chl3
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Flower 1 37 36.997 0.1701 0.6801
## Residuals 1790 389333 217.505
FF<- lm(Dat$Flav5 ~ Dat$Flower)
anova(FF)
## Analysis of Variance Table
##
## Response: Dat$Flav5
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Flower 1 0.248 0.247514 4.4866 0.0343 *
## Residuals 1790 98.750 0.055168
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
NF<- lm(Dat$NBI4 ~ Dat$Flower)
anova(NF)
## Analysis of Variance Table
##
## Response: Dat$NBI4
## Df Sum Sq Mean Sq F value Pr(>F)
## Dat$Flower 1 12 11.938 0.1788 0.6725
## Residuals 1790 119544 66.784
EH = read.xlsx("HeightL.xlsx", sheetName = "Sheet1")
heatmaply(EH,Colv = FALSE, Rowv = FALSE, xlab = "Column",ylab = "Row", main = "Tree Height Across Planting Block")